home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_7 / issue_07 / drawfile / doc / SWI's
Encoding:
Text File  |  1993-09-28  |  3.1 KB  |  121 lines

  1. SWI's
  2. =====
  3.  
  4. Here are the SWI's provided by the DrawFile module.
  5.  
  6.  
  7.  
  8. DrawFile_Render
  9. ---------------
  10.  
  11. Entry:
  12.  
  13.    R0    =  flags:
  14.                bit 0: render bounding boxes (as dotted red rectangles)
  15.                bit 1: do not render the objects themselves
  16.    R1    -> draw file data
  17.    R2    =  size of draw file in bytes
  18.    R3    -> transformation matrix
  19.          =  0 <=> use identity
  20.    R4    -> clipping rectangle in O S units
  21.          =  0 <=> no clipping rectangle set up
  22.  
  23. Exit:
  24.  
  25.    All registers preserved
  26.  
  27. Use:
  28.  
  29.    This SWI renders a draw file at a given screen position where that
  30. position is defined as screen position 0, 0 with the x- and y-translations
  31. as specified in the transformation matrix. Hence to render a non-rotated 1:1
  32. draw file at (x, y) (screen coordinates in O S units) the transformation
  33. matrix is
  34.  
  35.       (1 << 16        0)
  36.       (      0  1 << 16)
  37.       (  256*x    256*y).
  38.  
  39. The effects of calling the module with the matrix not of the form
  40.  
  41.       (f  0)
  42.       (0  f)
  43.       (x  y)
  44.  
  45. (which is a translation and a magnification) should not be relied on. The
  46. clipping rectangle is typically a redraw rectangle returned by the Wimp on a
  47. redraw window request.  If R4 = 0, then the whole draw file is rendered. If
  48. non-zero, only objects which intersect the clipping rectangle are rendered.
  49. If R3 = 0, then unit transformation matrix is assumed (i e, the draw file is
  50. rendered with its bottom left corner at screen coordinates (0, 0)).
  51.  
  52. Altering the transformation matrix can allow you to alter the scale of the
  53. diagram.  For example, you can use the following transformation matrix to
  54. render your diagram at a scale of 2:1 :-
  55.  
  56.       (1 << 17        0)
  57.       (      0  1 << 17)
  58.       (  256*x    256*y).
  59.  
  60. and the following to render your diagram at half scale :-
  61.  
  62.  
  63.       (1 << 15        0)
  64.       (      0  1 << 15)
  65.       (  256*x    256*y).
  66.  
  67.  
  68.  
  69. DrawFile_BBox
  70. -------------
  71.  
  72. Entry:
  73.  
  74.    R0    =  flags (must be 0)
  75.    R1    -> draw file data
  76.    R2    =  size of draw file in bytes
  77.    R3    -> transformation matrix
  78.          =  0 <=> use identity
  79.    R4    -> 4-word buffer to hold the bounding box of the draw file
  80.             (x0, y0, x1, y1) in draw units
  81.  
  82. Exit:
  83.  
  84.    All registers preserved. Buffer pointed at by R4 holds the bounding box
  85. of the draw file (x0, y0, x1, y1) in draw units.
  86.  
  87. Use:
  88.  
  89.    This SWI is used to determine the bounding box (in draw units) of the
  90. given draw file, as if it were plotted with the transformation given.
  91.  
  92. DrawFile_DeclareFonts
  93. ---------------------
  94.  
  95. Entry:
  96.  
  97.    R0    =  flags
  98.                bit 0: do not download font (passed to PDriver_DeclareFont)
  99.    R1    -> draw file data
  100.    R2    =  size of draw file in bytes
  101.  
  102. Exit:
  103.  
  104.    All registers preserved. All fonts used by the document have been
  105. declared.
  106.  
  107. Use:
  108.  
  109.    If a printer requires font declarations, this SWI must be called for each
  110. drawfile to be printed, between the calls to PDriver_SelectJob and
  111. PDriver_DrawPage.
  112.  
  113.    All fonts are declared as "kerned," since this includes the non-kerned
  114. case.
  115.  
  116. Other information
  117. ---- ------------
  118.  
  119.    The SWI chunk number of the DrawFile module is 0x45540 and its error base
  120. is 0x20C00.
  121.